# -*- coding: utf-8 -*-

from flask import Flask
from flask import current_app

from flask import Blueprint

bp = Blueprint(name="blueprint", import_name=__name__, url_prefix="/blueprint")


@bp.route('/home')
def home():
    current_app.logger.info("home")
    return 'home'


app = Flask(__name__)


@app.route('/flask/index')
def index():
    current_app.logger.info("index")
    return 'index'


if __name__ == '__main__':
    """
    curl http://127.0.0.1:5005/flask/index
    curl http://127.0.0.1:5005/blueprint/home
    """
    app.register_blueprint(bp)
    app.debug = True
    app.run(port=5005)
